package com.lianxi

/**
  * Created by adengdeng on 2017/8/8 
  */
object Lx9 {

  def lteqgt(values: Array[Int], v: Int) = {
    val map = scala.collection.mutable.HashMap((1, 0), (2, 0), (3, 0))

    for (i <- values) {
      if (i < v) {
        map(1) = map(1) + 1
      } else if (i == v) {
        map(2) = map(2) + 1
      } else
        map(3) = map(3) + 1
    }
    (map(1),map(2),map(3))
  }

  def main(args: Array[String]): Unit = {

    val a = Array(1,2,3,4)

    println(lteqgt(a, 2))
  }
}
